home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / unix / i386 / sysdep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-18  |  1.9 KB  |  52 lines

  1. /* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #include <sysdeps/unix/sysdep.h>
  20.  
  21. #define    ENTRY(name)                                  \
  22.   .globl C_SYMBOL_NAME(name);                              \
  23.   .align 4;                                      \
  24.   C_LABEL(name)
  25.  
  26. #ifdef    NO_UNDERSCORES
  27. /* Since C identifiers are not normally prefixed with an underscore
  28.    on this system, the asm identifier `syscall_error' intrudes on the
  29.    C name space.  Make sure we use an innocuous name.  */
  30. #define    syscall_error    __syscall_error
  31. #endif
  32.  
  33. #define    PSEUDO(name, syscall_name, args)                      \
  34.   .globl syscall_error;                                  \
  35.   ENTRY (name)                                      \
  36.   DO_CALL (syscall_name, args);                              \
  37.   jb syscall_error
  38.  
  39. /* This is defined as a separate macro so that other sysdep.h files
  40.    can include this one and then redefine DO_CALL.  */
  41.  
  42. #define DO_CALL(syscall_name, args)                          \
  43.   lea SYS_ify (syscall_name), %eax;                          \
  44.   /* lcall $7, $0; */                                  \
  45.   /* Above loses; GAS bug.  */                              \
  46.   .byte 0x9a, 0, 0, 0, 0, 7, 0
  47.  
  48. #define    r0        %eax    /* Normal return-value register.  */
  49. #define    r1        %edx    /* Secondary return-value register.  */
  50. #define scratch     %ecx    /* Call-clobbered register for random use.  */
  51. #define MOVE(x,y)    movl x, y
  52.